import request from '@/utils/request'

// 激活码列表
export function codeList(query) {
  return request({
    url: '/batch-activation-code-summaries',
    method: 'get',
    params: query
  })
}

// 删除
export function delUser(id) {
  return request({
    url: '/batch-activation-code-summaries/' + id,
    method: 'delete'
  })
}


//新增
export function addCode(data) {
  return request({
    url: '/batch-activation-code-summaries',
    method: 'post',
    data: data
  })
}

//查看详情
export function detailCode(data) {
  return request({
    url: '/activation-codes/' + data.id + '?pageSize=' + data.pageSize + '&pageNum=' + data.pageNum,
    method: 'get'
    // params: id
  })
}

// 导出
export function exportUser(query) {
  return request({
    url: `/activation-codes/${query.batchId}/export`,
    method: 'get'
  })
}


//激活码激活&冻结
export function activation(query) {
  return request({
    url: '/activation-codes',
    method: 'put',
    data: query
  })
}



//数量查看具体权限
export function chcekProducts(query) {
  return request({
    url: `/batch-activation-code-summaries/${query}/products`,
    method: 'get'
  })
}
// /client-users/{userId}/products
//数量查看具体权限
export function getCode(query) {
  return request({
    url: `/client-users/${query}/products`,
    method: 'get'
  })
}
